Optimal. Leaf size=42 \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}-\frac{\tanh ^{-1}(\cos (x))}{a+b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0491304, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {3190, 391, 206, 205} \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}-\frac{\tanh ^{-1}(\cos (x))}{a+b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3190
Rule 391
Rule 206
Rule 205
Rubi steps
\begin{align*} \int \frac{\csc (x)}{a+b \cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\cos (x)\right )\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (x)\right )}{a+b}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\cos (x)\right )}{a+b}\\ &=-\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}-\frac{\tanh ^{-1}(\cos (x))}{a+b}\\ \end{align*}
Mathematica [A] time = 0.0469493, size = 50, normalized size = 1.19 \[ \frac{-\frac{2 \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a}}+\log (1-\cos (x))-\log (\cos (x)+1)}{2 (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.036, size = 56, normalized size = 1.3 \begin{align*} -{\frac{\ln \left ( 1+\cos \left ( x \right ) \right ) }{2\,a+2\,b}}+{\frac{\ln \left ( \cos \left ( x \right ) -1 \right ) }{2\,a+2\,b}}-{\frac{b}{a+b}\arctan \left ({b\cos \left ( x \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.78181, size = 329, normalized size = 7.83 \begin{align*} \left [\frac{\sqrt{-\frac{b}{a}} \log \left (\frac{b \cos \left (x\right )^{2} - 2 \, a \sqrt{-\frac{b}{a}} \cos \left (x\right ) - a}{b \cos \left (x\right )^{2} + a}\right ) - \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )}}, -\frac{2 \, \sqrt{\frac{b}{a}} \arctan \left (\sqrt{\frac{b}{a}} \cos \left (x\right )\right ) + \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) - \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.20055, size = 68, normalized size = 1.62 \begin{align*} -\frac{b \arctan \left (\frac{b \cos \left (x\right )}{\sqrt{a b}}\right )}{\sqrt{a b}{\left (a + b\right )}} - \frac{\log \left (\cos \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}} + \frac{\log \left (-\cos \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]